// run: $exec < input
#include <cstdio>

int const maxn = 510000;
int const max_len = 1100000;
int a[maxn];
short vis[max_len];
int s = 1000000;
int n;

int main()
{
	std::scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		std::scanf("%d", &a[i]);
		vis[a[i]] = 1;
	}
	int count = 0;
	for (int i = 0, x; i < n; i++) {
		x = a[i];
		if (!vis[s - x + 1]) vis[s - x + 1] = 2;
		else if (x <= s/2) count++;
	}
	std::printf("%d\n", n);
	for (int i = 1; i <= s; i++)
		if (vis[i] == 2) std::printf("%d ", i);
		else if (!vis[i] && !vis[s - i + 1] && count) {
			count--;
			std::printf("%d ", i);
			vis[s - i + 1] = 2;
			vis[i] = 2;
		}
	std::printf("\n");
}

